home *** CD-ROM | disk | FTP | other *** search
/ El Mac 9 / El Mac 9.iso / Shareware / Applications / Charting Coach v1.5 / Charting Coach v1.dxr / 00593.ls < prev    next >
Encoding:
Text File  |  1996-04-08  |  7.8 KB  |  297 lines

  1. on getAbstainAdvice
  2.   global dayNo, bioInfo, stamp, PeakDayNo, endDate, beginDate, basis, advice, relations, previousPeak, mucusNotPeak, bleedPeak
  3.   set basisNo to 0
  4.   set adviceno to 0
  5.   if getAt(stamp, dayNo) = 1 then
  6.     if getOnlyRedPrevious() = 1 then
  7.       set adviceno to 101
  8.       set basisNo to 101
  9.     else
  10.       set PeakDayNo to dayNo
  11.       set bleedPeak to dayNo
  12.       if getAnovulatory() then
  13.         set adviceno to 101
  14.         set basisNo to 103
  15.       else
  16.         if upToNow10(dayNo) then
  17.           set adviceno to 107
  18.           set basisNo to 102
  19.         else
  20.           set adviceno to 101
  21.           set basisNo to 113
  22.         end if
  23.       end if
  24.     end if
  25.   end if
  26.   if getAt(stamp, dayNo) = 2 then
  27.     if upToNow10(dayNo) or start3YellowBabies() then
  28.       set adviceno to 110
  29.       set basisNo to 112
  30.     else
  31.       if dayNo = 1 then
  32.         set adviceno to 101
  33.       else
  34.         if getAt(relations, dayNo - 1) = 4 then
  35.           set adviceno to 102
  36.         else
  37.           set adviceno to 104
  38.         end if
  39.       end if
  40.       set basisNo to 105
  41.     end if
  42.   end if
  43.   if (getAt(stamp, dayNo) = 3) or (getAt(stamp, dayNo) = 10) then
  44.     set adviceno to 101
  45.     if getAt(stamp, dayNo) = 3 then
  46.       set PeakDayNo to 0
  47.     end if
  48.     if dayNo <= previousPeak then
  49.       set basisNo to 125
  50.     else
  51.       set basisNo to 106
  52.     end if
  53.   end if
  54.   if (getAt(stamp, dayNo) = 5) and getAnovulatory() then
  55.     if dayNo = 1 then
  56.       set PeakDayNo to 0
  57.       set basisNo to 103
  58.       set adviceno to 107
  59.     else
  60.       if getAt(stamp, dayNo - 1) = 1 then
  61.         set PeakDayNo to dayNo - 1
  62.         set basisNo to 103
  63.         set adviceno to 107
  64.       else
  65.         set SincePeak to dayNo - PeakDayNo
  66.         set basisNo to 116 + SincePeak
  67.         set adviceno to 106 + SincePeak
  68.       end if
  69.     end if
  70.   end if
  71.   if (getAt(stamp, dayNo) = 4) or ((getAt(stamp, dayNo) = 5) and not getAnovulatory()) then
  72.     set basisNo to 0
  73.     if dayNo = 1 then
  74.       set basisNo to 106
  75.       set adviceno to 101
  76.     else
  77.       if (getAt(mucus, dayNo - 1) < 7) and (getAt(mucus, dayNo - 1) > 1) and (dayNo > (previousPeak + 1)) then
  78.         if getOne(stamp, 10) <> 0 then
  79.           setAt(stamp, getOne(stamp, 10), 3)
  80.         end if
  81.         setAt(stamp, dayNo - 1, 10)
  82.         set PeakDayNo to dayNo - 1
  83.         if the frame <> label("Save Changes") then
  84.           showDays()
  85.         end if
  86.       else
  87.         if getAt(stamp, dayNo - 1) = 3 then
  88.           if getAt(stamp, dayNo) = 5 then
  89.             set PeakDayNo to dayNo - 1
  90.             set basisNo to 115
  91.           else
  92.             set basisNo to 125
  93.           end if
  94.         end if
  95.       end if
  96.       if PeakDayNo > 0 then
  97.         set SincePeak to dayNo - PeakDayNo
  98.         if (basisNo <> 115) and (basisNo <> 125) then
  99.           if not upToNow10(dayNo) or ((dayNo - getOne(stamp, 10)) > 3) then
  100.             set basisNo to 116 + SincePeak
  101.           else
  102.             set basisNo to 106 + SincePeak
  103.           end if
  104.         end if
  105.         set adviceno to 106 + SincePeak
  106.       else
  107.         set adviceno to 101
  108.         if (previousPeak < dayNo) and (dayNo > 3) then
  109.           set basisNo to 126
  110.         else
  111.           set basisNo to 106
  112.         end if
  113.       end if
  114.     end if
  115.   end if
  116.   if getAt(stamp, dayNo) = 6 then
  117.     if not upToNow10(dayNo) then
  118.       if dayNo = 1 then
  119.         set adviceno to 101
  120.       else
  121.         if getAt(relations, dayNo - 1) = 4 then
  122.           set adviceno to 102
  123.         else
  124.           set adviceno to 104
  125.         end if
  126.       end if
  127.       set basisNo to 111
  128.     else
  129.       set adviceno to 110
  130.       set basisNo to 112
  131.     end if
  132.   end if
  133.   if violatedRule() and (adviceno <> 0) then
  134.     set adviceno to adviceno + 1000
  135.   end if
  136.   if inspectbasis(basisNo) then
  137.     append(advice, adviceno)
  138.     append(basis, basisNo)
  139.   else
  140.     append(advice, 500)
  141.     append(basis, 500)
  142.   end if
  143. end
  144.  
  145. on getConceiveAdvice
  146.   global dayNo, bioInfo, stamp, PeakDayNo, endDate, beginDate, basis, advice, relations, previousPeak, bleedPeak
  147.   set basisNo to 0
  148.   set adviceno to 0
  149.   if getAt(stamp, dayNo) = 1 then
  150.     if getOnlyRedPrevious() = 1 then
  151.       set adviceno to 101
  152.       set basisNo to 201
  153.     else
  154.       set PeakDayNo to dayNo
  155.       set bleedPeak to dayNo
  156.       if getAnovulatory() then
  157.         set adviceno to 202
  158.         set basisNo to 203
  159.       else
  160.         if upToNow10(dayNo) then
  161.           set adviceno to 202
  162.           set basisNo to 202
  163.         else
  164.           set adviceno to 202
  165.           set basisNo to 113
  166.         end if
  167.       end if
  168.     end if
  169.   end if
  170.   if getAt(stamp, dayNo) = 2 then
  171.     if upToNow10(dayNo) or start3YellowBabies() then
  172.       set adviceno to 110
  173.       set basisNo to 210
  174.     else
  175.       if dayNo = 1 then
  176.         set adviceno to 101
  177.       else
  178.         if getAt(relations, dayNo - 1) = 4 then
  179.           set adviceno to 102
  180.         else
  181.           set adviceno to 104
  182.         end if
  183.       end if
  184.       set basisNo to 205
  185.     end if
  186.   end if
  187.   if (getAt(stamp, dayNo) = 3) or (getAt(stamp, dayNo) = 10) then
  188.     if getAt(stamp, dayNo) = 3 then
  189.       set PeakDayNo to 0
  190.     end if
  191.     if (getAt(mucus, dayNo) < 7) and (getAt(mucus, dayNo) > 2) then
  192.       set adviceno to 105
  193.     else
  194.       set adviceno to 103
  195.     end if
  196.     if dayNo <= previousPeak then
  197.       set basisNo to 226
  198.     else
  199.       set basisNo to 206
  200.     end if
  201.   end if
  202.   if (getAt(stamp, dayNo) = 5) and getAnovulatory() then
  203.     if dayNo = 1 then
  204.       set PeakDayNo to 0
  205.       set basisNo to 203
  206.       set adviceno to 103
  207.     else
  208.       if getAt(stamp, dayNo - 1) = 1 then
  209.         set PeakDayNo to dayNo - 1
  210.         set basisNo to 203
  211.         set adviceno to 103
  212.       else
  213.         set SincePeak to dayNo - PeakDayNo
  214.         set basisNo to 216 + SincePeak
  215.         set adviceno to 103
  216.       end if
  217.     end if
  218.   end if
  219.   if (getAt(stamp, dayNo) = 4) or ((getAt(stamp, dayNo) = 5) and not getAnovulatory()) then
  220.     set basisNo to 0
  221.     set adviceno to 103
  222.     if dayNo = 1 then
  223.       set basisNo to 206
  224.       set adviceno to 103
  225.     else
  226.       if (getAt(mucus, dayNo - 1) < 7) and (getAt(mucus, dayNo - 1) > 1) and (dayNo > (previousPeak + 1)) then
  227.         if getOne(stamp, 10) <> 0 then
  228.           setAt(stamp, getOne(stamp, 10), 3)
  229.         end if
  230.         setAt(stamp, dayNo - 1, 10)
  231.         set PeakDayNo to dayNo - 1
  232.         if the frame <> label("Save Changes") then
  233.           showDays()
  234.         end if
  235.       else
  236.         if getAt(stamp, dayNo - 1) = 3 then
  237.           if getAt(stamp, dayNo) = 5 then
  238.             set PeakDayNo to dayNo - 1
  239.             set basisNo to 215
  240.           else
  241.             set basisNo to 225
  242.           end if
  243.         end if
  244.       end if
  245.       if PeakDayNo > 0 then
  246.         set SincePeak to dayNo - PeakDayNo
  247.         if (basisNo <> 215) and (basisNo <> 225) then
  248.           if not upToNow10(dayNo) or ((dayNo - getOne(stamp, 10)) > 3) then
  249.             set basisNo to 216 + SincePeak
  250.           else
  251.             set basisNo to 206 + SincePeak
  252.           end if
  253.           set adviceno to 103
  254.         end if
  255.       else
  256.         if (previousPeak < dayNo) and (dayNo > 3) then
  257.           set basisNo to 226
  258.         else
  259.           set basisNo to 206
  260.         end if
  261.       end if
  262.     end if
  263.     if (getAt(mucus, dayNo) < 7) and (getAt(mucus, dayNo) > 2) then
  264.       set adviceno to 105
  265.     else
  266.       set adviceno to 103
  267.     end if
  268.   end if
  269.   if getAt(stamp, dayNo) = 6 then
  270.     if not upToNow10(dayNo) then
  271.       if dayNo = 1 then
  272.         set adviceno to 101
  273.       else
  274.         if getAt(relations, dayNo - 1) = 4 then
  275.           set adviceno to 102
  276.         else
  277.           set adviceno to 104
  278.         end if
  279.       end if
  280.       set basisNo to 211
  281.     else
  282.       set adviceno to 110
  283.       set basisNo to 210
  284.     end if
  285.   end if
  286.   if violatedRule() and (adviceno <> 0) then
  287.     set adviceno to adviceno + 1000
  288.   end if
  289.   if inspectbasis(basisNo) then
  290.     append(advice, adviceno)
  291.     append(basis, basisNo)
  292.   else
  293.     append(advice, 500)
  294.     append(basis, 500)
  295.   end if
  296. end
  297.